package Command;

import java.util.ArrayList;
import Server.Command;
import Server.cmdArguments;

public class GetCommand implements Command {
	private cmdArguments args;
	
	public GetCommand(){}

	@Override
	public String execute() {
		String result = "Command not allowed without the database.";
		if (args.db) {
			ArrayList<Integer> c = args.da.get();
			args.ds.addAll(c);
			
			result = "Database values added to the data set. In total " + c.size() + " entries.";
		}
		return result;
	}	

	@Override
	public String undo() {
		return "Undo not possible when you have the Database.";
	}
	
	@Override
	public void setArgs(cmdArguments args) {
		this.args=args;
	}
}
